package com.xiaodeng.xdblogspringboot.validation;

import com.xiaodeng.xdblogspringboot.anno.ApplicationState;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class ApplicationValidation implements ConstraintValidator<ApplicationState,String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        //提供检验规则
        if (value == null){
            return false;
        }
        return value.equals("待审核") || value.equals("审核成功") || value.equals("审核失败");
    }
}
